#pragma once

// Source of GetUnconnectedPin and ConnectFilters
// can be found in MSDN
HRESULT GetUnconnectedPin(
    IBaseFilter *pFilter,   // Pointer to the filter.
    PIN_DIRECTION PinDir,   // Direction of the pin to find.
    IPin **ppPin);           // Receives a pointer to the pin.

HRESULT ConnectFilters(
    IGraphBuilder *pGraph, // Filter Graph Manager.
    IPin *pOut,            // Output pin on the upstream filter.
    IBaseFilter *pDest);    // Downstream filter.

HRESULT WriteToSurface(LPDIRECTDRAWSURFACE7 surf, ISampleGrabber *pSGrabber,
					   IMediaControl * pControl, IMediaEvent * pEvent);

HRESULT InitDShow (ISampleGrabber **ppSGrabber,
    IMediaControl **ppControl, IMediaEvent   **ppEvent,
	LPDIRECTDRAWSURFACE7 *surf);

HRESULT ReleaseDShow(LPDIRECTDRAWSURFACE7 surf, ISampleGrabber *pSGrabber,
					   IMediaControl * pControl, IMediaEvent * pEvent);